﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/Admin.Master"
    CodeBehind="MyList.aspx.cs" Inherits="TimeAxis.Admin.MyList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        function gotonewurl() {
            var query = $("input[name='querycategory']");
            var param = "";
            for (var i = 0; i < query.length; i++) {
                //alert($(query[i]).attr("checked"));
                if ($(query[i]).attr("checked") == true) {
                    //alert($(query[i]).val());
                    param += $(query[i]).val() + ",";
                }
            }
            param = param.substr(0, param.length - 1);
            location.href = "/Admin/MyList.aspx?param=" + param;
        }
    </script>
    <div class="accountInfo" style="width: 95%;">
        <fieldset class="login">
            <legend>选择相关的项目</legend>
            <p>
                <%
                    foreach (TimeAxis.Models.Category c in categorys)
                    {
                        var exist = false;
                        if (queryparam != null)
                        {
                            foreach (string cp in queryparam)
                            {
                                if (cp.Equals(c.Id.ToString()))
                                {
                                    exist = true;
                                    break;
                                }
                            }
                        }
                        if (exist)
                        {
                            Response.Write("<input type=\"checkbox\" name=\"querycategory\" value=\"" + c.Id + "\" checked=\"checked\" />" + c.CName + "&nbsp;&nbsp;&nbsp;&nbsp;");
                        }
                        else
                        {
                            Response.Write("<input type=\"checkbox\" name=\"querycategory\" value=\"" + c.Id + "\" />" + c.CName + "&nbsp;&nbsp;&nbsp;&nbsp;");
                        }
                    }
                    Response.Write("<span onclick=\"gotonewurl()\" style=\"color:blue;cursor:pointer;\">查询</span>");
                %>
            </p>
        </fieldset>
    </div>
    <div style="clear: both;">
    </div>
    <div style="width: 100%; height: 30px;">
    </div>
    <div class="accountInfo" style="width: 95%;">
        <fieldset class="login" id="mylist">
            <legend>相关的问题</legend>
            <%
                foreach (TimeAxis.Models.Doc doc in docs)
                {
                    Response.Write("<p style=\"line-height:22px;\"> <a href=\"/Admin/Manager/DocEdit.aspx?docid=" + doc.Id + "\" style=\"float:left;text-decoration:none;width:90%;\">" + doc.Title + "</a><span style=\"float:right;\">" + doc.Pdate.ToShortDateString() + "</span></p><div style=\"clear:both;\"></div>");
                }
            %>
        </fieldset>
    </div>
    <div style="width: 100%; text-align: right;">
        <div class="back" onclick="javascript:top.location.href='/Admin/Manager/Default.aspx';">
            返回</div>
        <div class="back" onclick="javascript:top.location.href='/Admin/Manager/CreateDoc.aspx';">
            新建</div>
    </div>
</asp:Content>
